import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 眼镜店信息信息 */
export interface OpticalShop {
          id: number; // 主键编号
          shopName?: string; // 店铺名称
          shopAddress?: string; // 店铺地址
          phone: string; // 联系电话
          businessHours: string; // 营业时间
          contactPerson: string; // 联系人姓名
          contactPhone: string; // 联系人电话
          contactEmail: string; // 联系人邮箱
          description: string; // 店铺描述
          status?: number; // 状态（0-正常 1-停业）
          areaId: number; // 所属地区编号
          areaName: string; // 所属地区名称
  }

// 眼镜店信息 API
export const OpticalShopApi = {
  // 查询眼镜店信息分页
  getOpticalShopPage: async (params: any) => {
    return await request.get({ url: `/mcm/optical-shop/page`, params })
  },

  // 查询眼镜店信息详情
  getOpticalShop: async (id: number) => {
    return await request.get({ url: `/mcm/optical-shop/get?id=` + id })
  },

  // 新增眼镜店信息
  createOpticalShop: async (data: OpticalShop) => {
    return await request.post({ url: `/mcm/optical-shop/create`, data })
  },

  // 修改眼镜店信息
  updateOpticalShop: async (data: OpticalShop) => {
    return await request.put({ url: `/mcm/optical-shop/update`, data })
  },

  // 删除眼镜店信息
  deleteOpticalShop: async (id: number) => {
    return await request.delete({ url: `/mcm/optical-shop/delete?id=` + id })
  },

  /** 批量删除眼镜店信息 */
  deleteOpticalShopList: async (ids: number[]) => {
    return await request.delete({ url: `/mcm/optical-shop/delete-list?ids=${ids.join(',')}` })
  },

  // 导出眼镜店信息 Excel
  exportOpticalShop: async (params) => {
    return await request.download({ url: `/mcm/optical-shop/export-excel`, params })
  },
}